<?php

#<editor-fold defaultstate="collapsed" desc="start">
ini_set('max_execution_time', 10);
include 'core/core.php';

CCore::Using('base.developments.logger');
CCore::Using('logger.inline');
CCore::Using('logger.file');
$oLogger = null;
$oDevLogger = null;
#</editor-fold>

$oLogger = new CCoreLoggerInline("\r\n", true);
$oLogger1 = new CCoreLoggerFile('c:/rr.txt');

$oDevLogger = new CCoreBaseDevelopmentsLogger($oLogger);
$oDevLogger1 = new CCoreBaseDevelopmentsLogger($oLogger1);

/**/
CCore::Using('socket.pop3');
CCore::Using('socket.inc.streams.testfiles');
CCore::Using('socket.inc.streams.pop3server');
CCore::Using('socket.inc.streams.web');

$oPop3Config = new CCoreSocketPop3Config('u-server', 110, 'test', 'p12345', 5, 5);
$oPop3 = new CCoreSocketPop3($oPop3Config, array($oDevLogger));

echo '<pre>';

// $oSocketStream = new CCoreSocketIncStreamsTestFiles('examples/filestream.pop3');
// $oSocketStream = new CCoreSocketIncStreamsWeb('http://127.0.0.1/core/s.php');
$oSocketStream = new CCoreSocketIncStreamsPop3Server('examples/filestorage.pop3');
$oPop3->SetStream($oSocketStream);

if ($oPop3->ConnectAndLogin())
{
	$oPop3->Uidl(2);
	$oPop3->Sizes();
	$oPop3->GetTop(2);
	$oPop3->GetTop(3);
}
else
{
	echo 'Error';
}

unset($oPop3);
